{{ define "posts/index.html" }}
    {{template "public/header" .}}

    <!-- 中间内容区局 -->
    <div class="container">
        <div class="row">
            <!-- 左侧菜单区域   -->
            {{block "menu" .}}{{end}}

            <!-- 右侧内容区域 -->
            <div class="col-md-9">
                <div class="panel panel-default">
                    <div class="panel-heading">学生列表</div>
                    <table class="table table-striped table-hover table-responsive">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>姓名</th>
                            <th>年龄</th>
                            <th>性别</th>
                            <th>添加时间</th>
                            <th>更新时间</th>
                            <th width="120">操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        {{ range .data }}
                        <tr>
                            <th scope="row">{{ .ID }}</th>
                            <td>{{ .Name }}</td>
                            <td>{{ .Age }}</td>
                            <td>{{ .Gender }}</td>
                            <td>{{ .CreatedAt }}</td>
                            <td>{{ .UpdatedAt }}</td>
                            <td>
                                <a href="/posts/detail?id={{ .ID }}">详情</a>
                                <a href="/posts/update?id={{ .ID }}">修改</a>
                                <a href="/posts/delete?id={{ .ID }}" onclick="">删除</a>
                            </td>
                        </tr>
                        {{ end }}

                        </tbody>
                    </table>
                </div>

                <!-- 分页  -->
                <div>
                    <div class="pull-right">
                        1
                    </div>
                </div>
            </div>

        </div>
    </div>

    {{template "public/footer" .}}
{{ end }}